package com.azxcrm.project.system.customer.service;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.azxcrm.common.utils.StringUtils;
import com.azxcrm.project.system.customer.dao.ICustomerClueDetailDao;
import com.azxcrm.project.system.customer.domain.CustomerClueDetail;
import com.azxcrm.project.system.customer.service.ICustomerClueDetailService;

/**
 * 客户线索详细问题分类 服务层实现
 * 
 * @author Dustyone
 * @date 2018-09-05
 */
@Service
public class CustomerClueDetailServiceImpl implements ICustomerClueDetailService 
{
	@Autowired
	private ICustomerClueDetailDao customerClueDetailDao;
	
	/**
     * 查询客户线索详细问题分类信息
     * 
     * @param detailId 客户线索详细问题分类ID
     * @return 客户线索详细问题分类信息
     */
	 @Override
	public CustomerClueDetail selectCustomerClueDetailById(Integer detailId)
	{
	    return customerClueDetailDao.selectCustomerClueDetailById(detailId);
	}
	
	/**
     * 查询客户线索详细问题分类列表
     * 
     * @param customerClueDetail 客户线索详细问题分类信息
     * @return 客户线索详细问题分类集合
     */
	 @Override
	public List<CustomerClueDetail> selectCustomerClueDetailList(CustomerClueDetail customerClueDetail)
	{
	    return customerClueDetailDao.selectCustomerClueDetailList(customerClueDetail);
	}
	
    /**
     * 新增客户线索详细问题分类
     * 
     * @param customerClueDetail 客户线索详细问题分类信息
     * @return 结果
     */
	 @Override
	public int insertCustomerClueDetail(CustomerClueDetail customerClueDetail)
	{
	    return customerClueDetailDao.insertCustomerClueDetail(customerClueDetail);
	}
	
	/**
     * 修改客户线索详细问题分类
     * 
     * @param customerClueDetail 客户线索详细问题分类信息
     * @return 结果
     */
	 @Override
	public int updateCustomerClueDetail(CustomerClueDetail customerClueDetail)
	{
	    return customerClueDetailDao.updateCustomerClueDetail(customerClueDetail);
	}
	
	/**
     * 保存客户线索详细问题分类
     * 
     * @param customerClueDetail 客户线索详细问题分类信息
     * @return 结果
     */
	 @Override
	public int saveCustomerClueDetail(CustomerClueDetail customerClueDetail)
	{
	    Integer detailId = customerClueDetail.getDetailId();
		int rows = 0;
		if (StringUtils.isNotNull(detailId))
        {
		    rows = customerClueDetailDao.updateCustomerClueDetail(customerClueDetail);
		}
		else
        {
		    rows = customerClueDetailDao.insertCustomerClueDetail(customerClueDetail);
		}
		return rows;
	}
	
	/**
     * 删除客户线索详细问题分类信息
     * 
     * @param detailId 客户线索详细问题分类ID
     * @return 结果
     */
	 @Override
	public int deleteCustomerClueDetailById(Integer detailId)
	{
	    return customerClueDetailDao.deleteCustomerClueDetailById(detailId);
	}
	
	/**
     * 批量删除客户线索详细问题分类对象
     * 
     * @param detailIds 需要删除的数据ID
     * @return 结果
     */
	 @Override
	public int batchDeleteCustomerClueDetail(Integer[] detailIds)
	{
		return customerClueDetailDao.batchDeleteCustomerClueDetail(detailIds);
	}
	
}
